# coding=utf-8
from app.modules.common.utils import JsonEncoder
from .notifier import EVENT

"""
event ws监听事件
plan_${plan_id}_project 项目内工程信息变化消息
plan_${plan_id}_create 创建项目工程创建信息
"""


class NotifyModel(JsonEncoder):
    event = None
    data = None

    def __init__(self, event = EVENT, data = None):
        self.event = event
        data['NotifyEvent'] = event
        self.data = data

    def to_dict(self):
        return {
            'event': self.event,
            'data': self.data,
        }
